package com.feinno.urcs.group;

/**
 * 此类适用于Warning头
 * Created by Lei Gao on 5/8/15.
 */

public enum GroupError {

	/**
	 * 创建聊天室时，缺少成员列表或者列表为空
	 */
	NO_DESTINATIONS(403, 129, "GC-AS", "No destinations"),
	/**
	 * 创建聊天室时成员总数少于聊天室规定的最小人数
	 */
	TOO_FEW_PARTICIPANTS(488, 201, "GC-AS","Too few participants"),
	/**
	 * 创建聊天室时，群名称超过30字节限制
	 */
	GROUPNAME_EXCEED_LIMIT(413, 202, "GC-AS", "Group name exceed limit"),
	/**
	 * 创建聊天室时，群名称鉴权失败
	 */
	GROUPNAME_NOT_ALLOWED(403, 213, "GC-AS", "Group name not allowed by monitor plat"),
	/**
	 * 创建聊天室时，解析成员列表失败
	 */
	RESOURCE_LIST_SYNTAX_ERROR(400, 203, "GC-AS", "Resource-list syntax error"),
	/**
	 * 聊天室发起人创建的群数量已经超过系统上限
	 */
	CAN_NOT_CREATE_MORE_GROUP(403, 381, "GC-AS","Can not create more group"),
	/**
	 * 1、聊天室发起人参与的群数量已经超过系统上限
	 * 2、受邀人参与的群数量已经超过系统上限
	 */
	CAN_NOT_JOIN_MORE_GROUP(403, 382, "GC-AS", "Can not join more group"),
	/**
	 * 聊天室发起人管理的群数量已经超过系统上限
	 * 目的方用户管理的群数量已经超过系统上限
	 */
	CAN_NOT_MANAGE_MORE_GROUP(403, 383, "GC-AS", "Can not manage more group"),

	/**
	 * REFER请求中没有携带Refer-To头域
	 */
	REFER_TO_FIELD_REQUIRED(400, 204 ,"GC-AS", "Refer-To field required"),
	/**
	 * 接收到Refer请求时，群不存在或者群静默（终端应先发送INVITE激活群会场再发起REFER）
	 */
	GROUP_NOT_ACTIVE(404, 205 ,"GC-AS", "Group not active"),
	/**
	 * 发起方非群成员
	 */
	ORIGINATOR_NOT_IN_GROUP(403, 206 ,"GC-AS", "Originator not in group"),
	/**
	 * 当前群内已确认成员总数已经超过群最大人数上限
	 */
	TOO_MANY_PARTICIPANTS(486, 102 ,"GC-AS", "Too many participants"),
	/**
	 * 被邀请用户是已确认成员，已经成功加入群
	 */
	DESTINATION_ALREADY_IN_GROUP(488, 207 ,"GC-AS", "Destination already in group"),

	/**
	 * 发起方非管理员或不具备群管理能力（缺少gpmanage能力）
	 */
	SERVICE_NOT_AUTHORISED(403, 208 ,"GC-AS",  "Service not authorised"),
	/**
	 * 被踢出的用户已经不在群中
	 */
	DESTINATION_NOT_IN_GROUP(488, 209 ,"GC-AS",  "Destination not in group"),

	/**
	 * 转移管理权限时，目的方用户非群成员
	 */
	CHANGE_ADMIN_DESTINATION_NOT_IN_GROUP(403, 209 ,"GC-AS",  "Destination not in group"),
	/**
	 * 转移管理权限时，目的方用户不具备群管理能力
	 */
	DESTINATION_MISS_GPMANAGE_CAPABILITY(403, 210 ,"GC-AS",  "Destination miss gpmanage capability"),

	/**
	 * 转移管理权限时，目的方用户与发起方相同
	 */
	CHANGE_ADMIN_OPER_LOOPED(403, 211 ,"GC-AS",  "Chanage admin oper looped"),

	/**
	 * 成员的新昵称超长(超过30字节)
	 */
	USER_NICKNAME_EXCEED_LIMIT(413, 212 ,"GC-AS",  "User nickname exceed limit"),

	/**
	 * 群名称鉴权失败
	 */
	GROUPNAME_NOT_ALLOWED_BY_MOBITOR_PLAT(403, 213 ,"GC-AS",  "Group name not allowed by monitor plat"),

	/**
	 * 未确认成员主动加入聊天室，但聊天室人数已经达到上限
	 */
	GROUP_CHAT_IS_FULL(403, 214 ,"GC-AS",  "Group chat is full"),
	/**
	 * 超过短信配额
	 */
	OUOT_OF_QUOTA(486, 109 ,"GC-AS",  "Member out of quota"),

	GROUP_NOT_FOUND(404, 205, "GC-AS", "Group not found"),

	SUBJECT_REQUIRED(400, 204 ,"GC-AS", "Subject field required"),
	REQUEST_URI_REQUIRED(400, 204 ,"GC-AS", "RequestUri field required"),
	CONVERSATION_ID_EXIST(400, 204 ,"GC-AS", "ConversationId exist"),
	GONE(410, 205 ,"GC-AS", "Gone"),;

	private int warningCode;
	private int sipCode;
	private String text;
	private String agent;

	GroupError(int sipCode,int warningCode, String agent, String text) {
		this.sipCode = sipCode;
		this.warningCode = warningCode;
		this.agent = agent;
		this.text = text;
	}

	public int getWarningCode() {
		return warningCode;
	}

	public void setWarningCode(int warningCode) {
		this.warningCode = warningCode;
	}

	public int getSipCode() {
		return sipCode;
	}

	public void setSipCode(int sipCode) {
		this.sipCode = sipCode;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public String getAgent() {
		return agent;
	}

	public void setAgent(String agent) {
		this.agent = agent;
	}
}
